package com.lzs.adx.web.modules.job.support;

import com.lzs.adx.commmon.utils.SpringContextUtils;
import com.lzs.adx.web.modules.job.support.faker.AbstractFakerBackStrategy;
import com.lzs.adx.web.modules.job.support.faker.FixedClickNumberFakerBackStrategy;
import com.lzs.adx.web.modules.job.support.faker.PerFakerBackStrategy;
import com.lzs.adx.web.modules.job.support.faker.RandomFakerBackStrategy;

public class FakerFactory {


    /**
     * 1：随机回传
     * 2.按比例回传 （回传指标，）
     * 3.按点击数回传（多少点击回传一个）
     *
     * @param type
     * @return
     */
    public static AbstractFakerBackStrategy getFakerBackStrategy(Integer type){
        if(type.equals(1)){
            return SpringContextUtils.getBean(RandomFakerBackStrategy.class);
        } else if (type.equals(2)) {
            return SpringContextUtils.getBean(PerFakerBackStrategy.class);
        } else if (type.equals(3)) {
            return SpringContextUtils.getBean(FixedClickNumberFakerBackStrategy.class);
        }else {
            throw new RuntimeException("不支持的回传类型");
        }
    }
}
